package demo1;

public class Test {
    public static void func(){
        System.out.println("func");
    }

    public static void main(String[] args) {
      /*  OuterClass outerClass = new OuterClass();
        OuterClass.Innerclass innerclass = new OuterClass.Innerclass();
        System.out.println(outerClass.data1);
        System.out.println(outerClass.data3);
        System.out.println(innerclass.data4);
        System.out.println(innerclass.data6);*/


        Test test = new Test();
        test.func();
        test.func();//虽然调用了两次,但是只实例化了一次对象


        new Test().func();//匿名方法
        new Test().func();//调用了两次,也实例化了两次
    }
}
